package org.example.lotterysystem.service.dto;

import java.util.List;
import java.util.Objects;

public class PageListDTO<T> {
    /**
     * 总量
     */
    private Integer total;

    /**
     * 当前页列表
     */
    private List<T> records;

    public PageListDTO(Integer total, List<T> records) {
        this.total = total;
        this.records = records;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        PageListDTO<?> that = (PageListDTO<?>) object;
        return Objects.equals(total, that.total) && Objects.equals(records, that.records);
    }

    @Override
    public int hashCode() {
        return Objects.hash(total, records);
    }
}
